package br.com.projetofx.modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;



@NamedQueries({@NamedQuery(name = "buscaClientePorNome", query = "select c from Cliente c where c.nome like :nome"),
    @NamedQuery(name = "getClienteCount", query = "select count(o) from Cliente as o"),
    @NamedQuery(name = "buscaClientePorCPFCNPJ", query = "select c from Cliente c where c.cpfCnpj like :cpf"),
    @NamedQuery(name = "buscaClientePorAtivos", query = "select c from Cliente c where c.ativo = TRUE"),
    @NamedQuery(name = "buscaClientePorBloqueados", query = "select c from Cliente c where c.ativo = FALSE"),
    @NamedQuery(name = "buscaClienteMasc", query = "select c from Cliente c where c.sexo = 'MASCULINO'"),
    @NamedQuery(name = "buscaClienteFemi", query = "select c from Cliente c where c.sexo = 'FEMININO'"),
    
})

@Entity
public class Cliente implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long idCliente;
	
	@Column(name = "Status")
	private boolean ativo = true;

	@Column(name = "Nome")
	private String nome;

	@Column(name = "CpfCnpj")
	private int cpfCnpj;

	@Column(name = "IeRg")
	private int ieRg;
	
	@Column(name = "Sexo")
	private String sexo;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dataCadastro;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dataAlteracao;

	
	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public int getCpfCnpj() {
		return cpfCnpj;
	}

	public void setCpfCnpj(int cpfCnpj) {
		this.cpfCnpj = cpfCnpj;
	}

	public int getIeRg() {
		return ieRg;
	}

	public void setIeRg(int ieRg) {
		this.ieRg = ieRg;
	}

	public Date getDataCadastro() {
		return dataCadastro;
	}

	public void setDataCadastro(Date dataCadastro) {
		this.dataCadastro = dataCadastro;
	}

	public Date getDataAlteracao() {
		return dataAlteracao;
	}

	public void setDataAlteracao(Date dataAlteracao) {
		this.dataAlteracao = dataAlteracao;
	}

	public long getIdCliente() {
		return idCliente;
	}

}
